package com.southpark.framework.control.events
{
	import com.adobe.cairngorm.control.CairngormEvent;
	import com.adobe.cairngorm.control.CairngormEventDispatcher;
	import com.southpark.framework.control.responders.IResponder;
	
	import flash.utils.getQualifiedClassName;
	
	
	public class AbstractEvent extends CairngormEvent implements IEvent
	{
		private var _responder:IResponder;
		public function get responder():IResponder
		{
			return _responder;
		}
		
		public function AbstractEvent(type:String,responder:IResponder)
		{
			_responder = responder;
			super(type);
		}
		
		override public function dispatch():Boolean
		{
			if (CairngormEventDispatcher.getInstance().hasEventListener(type))
			{
				return super.dispatch();
			};
			
			manageUnmapped();
			return false;
		}
		
		protected function manageUnmapped():void
		{
			trace("Event [" + getQualifiedClassName(this) + "] is not mapped");
		}
		
	}
}